﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Simulation
{
	class C_FRIA
	{
		F_SETT	ST = new F_SETT();

		int		RNID;
		Random	R = new Random( unchecked( ( int )DateTime.Now.Ticks ) );

		public int RandEvent()
		{
			RNID = R.Next( 1, ST.OTTND );
			return RNID;
		}

		public bool ChooseCompromisedNode()
		{
			if ( RNID <= ST.OFRAR )
				return true;

			return false;
		}

		public void MakeCompromisedNodes( C_NODE[] ND )
		{
			int ndid = -1;

			if ( ST.OFRIA == 1 )
			{
				for ( int i = 0; i < ST.OFRIR; i++ )
				{
					ndid = RandEvent();
					ND[ndid].CMND = true;
				}
			}
		}
	}
}
